{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Cifar10 Outlier Detection\n",
    "![demo](./demo.png)\n",
    "\n",
    "In this example we will deploy an image classification model along with an outlier detector trained on the same dataset. For in depth details on creating an outlier detection model for your own dataset see the [alibi-detect project](https://github.com/SeldonIO/alibi-detect) and associated [documentation](https://docs.seldon.io/projects/alibi-detect/en/latest/). You can find details for this [CIFAR10 example in their documentation](https://docs.seldon.io/projects/alibi-detect/en/latest/examples/od_vae_cifar10.html) as well.\n",
    "\n",
    "\n",
    "Prequisites:\n",
    "\n",
    " * Running cluster with \n",
    "    * [kfserving installed](https://github.com/kubeflow/kfserving/blob/master/README.md)\n",
    "    * [Knative eventing installed](https://knative.dev/docs/install/) >= 0.18\n",
    " \n",
    " Tested on GKE and Kind with Knative 0.18 and Istio 1.7.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install -r requirements_notebook.txt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup Resources"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "namespace/cifar10 created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create namespace cifar10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting broker.yaml\n"
     ]
    }
   ],
   "source": [
    "%%writefile broker.yaml\n",
    "apiVersion: eventing.knative.dev/v1\n",
    "kind: broker\n",
    "metadata:\n",
    " name: default\n",
    " namespace: cifar10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "broker.eventing.knative.dev/default created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f broker.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting event-display.yaml\n"
     ]
    }
   ],
   "source": [
    "%%writefile event-display.yaml\n",
    "apiVersion: apps/v1\n",
    "kind: Deployment\n",
    "metadata:\n",
    "  name: hello-display\n",
    "  namespace: cifar10\n",
    "spec:\n",
    "  replicas: 1\n",
    "  selector:\n",
    "    matchLabels: &labels\n",
    "      app: hello-display\n",
    "  template:\n",
    "    metadata:\n",
    "      labels: *labels\n",
    "    spec:\n",
    "      containers:\n",
    "        - name: event-display\n",
    "          image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display\n",
    "\n",
    "---\n",
    "\n",
    "kind: Service\n",
    "apiVersion: v1\n",
    "metadata:\n",
    "  name: hello-display\n",
    "  namespace: cifar10\n",
    "spec:\n",
    "  selector:\n",
    "    app: hello-display\n",
    "  ports:\n",
    "  - protocol: TCP\n",
    "    port: 80\n",
    "    targetPort: 8080"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "deployment.apps/hello-display created\n",
      "service/hello-display created\n"
     ]
    }
   ],
   "source": [
    "!kubectl apply -f event-display.yaml"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create the Kfserving image classification model for Cifar10. We add in a `logger` for requests."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting cifar10.yaml\n"
     ]
    }
   ],
   "source": [
    "%%writefile cifar10.yaml\n",
    "apiVersion: \"serving.kubeflow.org/v1alpha2\"\n",
    "kind: \"InferenceService\"\n",
    "metadata:\n",
    "  name: \"tfserving-cifar10\"\n",
    "  namespace: cifar10\n",
    "spec:\n",
    "  default:\n",
    "    predictor:\n",
    "      tensorflow:\n",
    "        storageUri: \"gs://kfserving-samples/tfserving/cifar10/resnet32\"\n",
    "      logger:\n",
    "        mode: all\n",
    "        url: http://broker-ingress.knative-eventing.svc.cluster.local/cifar10/default"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "inferenceservice.serving.kubeflow.org/tfserving-cifar10 created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl apply -f cifar10.yaml"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create the pretrained VAE Cifar10 Outlier Detector. We forward replies to the event-display we started."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting cifar10od.yaml\n"
     ]
    }
   ],
   "source": [
    "%%writefile cifar10od.yaml\n",
    "apiVersion: serving.knative.dev/v1\n",
    "kind: Service\n",
    "metadata:\n",
    "  name: vae-outlier\n",
    "  namespace: cifar10\n",
    "spec:\n",
    "  template:\n",
    "    metadata:\n",
    "      annotations:\n",
    "        autoscaling.knative.dev/minScale: \"1\"\n",
    "    spec:\n",
    "      containers:\n",
    "      - image: seldonio/alibi-detect-server:0.0.2\n",
    "        imagePullPolicy: IfNotPresent\n",
    "        args:\n",
    "        - --model_name\n",
    "        - cifar10od\n",
    "        - --http_port\n",
    "        - '8080'\n",
    "        - --protocol\n",
    "        - tensorflow.http\n",
    "        - --storage_uri\n",
    "        - gs://seldon-models/alibi-detect/od/OutlierVAE/cifar10\n",
    "        - --reply_url\n",
    "        - http://hello-display.cifar10\n",
    "        - --event_type\n",
    "        - org.kubeflow.serving.inference.outlier\n",
    "        - --event_source\n",
    "        - org.kubeflow.serving.cifar10od\n",
    "        - OutlierDetector\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "service.serving.knative.dev/vae-outlier created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl apply -f cifar10od.yaml"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create a Knative trigger to forward logging events to our Outlier Detector."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting trigger.yaml\n"
     ]
    }
   ],
   "source": [
    "%%writefile trigger.yaml\n",
    "apiVersion: eventing.knative.dev/v1\n",
    "kind: Trigger\n",
    "metadata:\n",
    "  name: vaeoutlier-trigger\n",
    "  namespace: cifar10\n",
    "spec:\n",
    "  broker: default\n",
    "  filter:\n",
    "    attributes:\n",
    "      type: org.kubeflow.serving.inference.request\n",
    "  subscriber:\n",
    "    ref:\n",
    "      apiVersion: serving.knative.dev/v1\n",
    "      kind: Service\n",
    "      name: vae-outlier\n",
    "      namespace: cifar10\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "trigger.eventing.knative.dev/vaeoutlier-trigger created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl apply -f trigger.yaml"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Get the IP address of the Istio Ingress Gateway. This assumes you have installed istio with a LoadBalancer."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "CLUSTER_IPS=!(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')\n",
    "CLUSTER_IP=CLUSTER_IPS[0]\n",
    "print(CLUSTER_IP)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you are using Kind or Minikube you will need to port-forward to the istio ingressgateway and uncomment the following cell.\n",
    "\n",
    "```\n",
    "INGRESS_GATEWAY_SERVICE=$(kubectl get svc --namespace istio-system --selector=\"app=istio-ingressgateway\" --output jsonpath='{.items[0].metadata.name}')\n",
    "kubectl port-forward --namespace istio-system svc/${INGRESS_GATEWAY_SERVICE} 8080:80\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#CLUSTER_IP=\"localhost:8080\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tfserving-cifar10.cifar10.example.com\n"
     ]
    }
   ],
   "source": [
    "SERVICE_HOSTNAMES=!(kubectl get inferenceservice -n cifar10 tfserving-cifar10 -o jsonpath='{.status.url}' | cut -d \"/\" -f 3)\n",
    "SERVICE_HOSTNAME_CIFAR10=SERVICE_HOSTNAMES[0]\n",
    "print(SERVICE_HOSTNAME_CIFAR10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "vae-outlier.cifar10.example.com\n"
     ]
    }
   ],
   "source": [
    "SERVICE_HOSTNAMES=!(kubectl get ksvc -n cifar10 vae-outlier -o jsonpath='{.status.url}' | cut -d \"/\" -f 3)\n",
    "SERVICE_HOSTNAME_VAEOD=SERVICE_HOSTNAMES[0]\n",
    "print(SERVICE_HOSTNAME_VAEOD)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(50000, 32, 32, 3) (50000, 1) (10000, 32, 32, 3) (10000, 1)\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import json\n",
    "import tensorflow as tf\n",
    "tf.keras.backend.clear_session()\n",
    "\n",
    "from alibi_detect.od.vae import OutlierVAE\n",
    "from alibi_detect.utils.perturbation import apply_mask\n",
    "from alibi_detect.utils.visualize import plot_feature_outlier_image\n",
    "import requests\n",
    "\n",
    "train, test = tf.keras.datasets.cifar10.load_data()\n",
    "X_train, y_train = train\n",
    "X_test, y_test = test\n",
    "\n",
    "X_train = X_train.astype('float32') / 255\n",
    "X_test = X_test.astype('float32') / 255\n",
    "print(X_train.shape, y_train.shape, X_test.shape, y_test.shape)\n",
    "classes = ('plane', 'car', 'bird', 'cat',\n",
    "           'deer', 'dog', 'frog', 'horse', 'ship', 'truck')\n",
    "\n",
    "def show(X):\n",
    "    plt.imshow(X.reshape(32, 32, 3))\n",
    "    plt.axis('off')\n",
    "    plt.show()\n",
    "\n",
    "def predict(X):\n",
    "    formData = {\n",
    "    'instances': X.tolist()\n",
    "    }\n",
    "    headers = {}\n",
    "    headers[\"Host\"] = SERVICE_HOSTNAME_CIFAR10\n",
    "    res = requests.post('http://'+CLUSTER_IP+'/v1/models/tfserving-cifar10:predict', json=formData, headers=headers)\n",
    "    if res.status_code == 200:\n",
    "        return classes[np.array(res.json()[\"predictions\"])[0].argmax()]\n",
    "    else:\n",
    "        print(\"Failed with \",res.status_code)\n",
    "        return []\n",
    "    \n",
    "def outlier(X):\n",
    "    formData = {\n",
    "    'instances': X.tolist()\n",
    "    }\n",
    "    headers = {\"Alibi-Detect-Return-Feature-Score\":\"true\",\"Alibi-Detect-Return-Instance-Score\":\"true\", \\\n",
    "                \"ce-namespace\": \"default\",\"ce-modelid\":\"cifar10\",\"ce-type\":\"io.seldon.serving.inference.request\", \\\n",
    "                \"ce-id\":\"1234\",\"ce-source\":\"localhost\",\"ce-specversion\":\"1.0\"}\n",
    "    headers[\"Host\"] = SERVICE_HOSTNAME_VAEOD\n",
    "    res = requests.post('http://'+CLUSTER_IP+'/', json=formData, headers=headers)\n",
    "    if res.status_code == 200:\n",
    "        od = res.json()\n",
    "        od[\"data\"][\"feature_score\"] = np.array(od[\"data\"][\"feature_score\"])\n",
    "        od[\"data\"][\"instance_score\"] = np.array(od[\"data\"][\"instance_score\"])\n",
    "        return od\n",
    "    else:\n",
    "        print(\"Failed with \",res.status_code)\n",
    "        return []"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Normal Prediction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVlElEQVR4nO2d2Y9kZ1LFI/elKpfasrauraurymV3224vjTdspIExA4MGNIDghSd4QuKBf4c3xAM8gIxlazR48ODxYHsse9ruvauXqq7urn3Jyn279/IPxAnJPDAhdH6P39GXeTPznrxSxBcRsSiKhBDij/hv+gIIITo0JyFOoTkJcQrNSYhTaE5CnJK0xH94/2cwlPvkztdw3+HmbXU9CPDbTc4/A7X55XWojUzNQy2b099v4+ZncM+j+9eg1q83oJYwPltxpAS1ZDavrl95822458Iq/q46ZydQu3njKtTCsKeu9/oduOfWzetQq1WPoNbtdaHW7yXU9ZPjFtzTaOFrHAT4vSYmRqE2MjoMtSCq6+/Vh1uk08ZZkff+7acxbZ1PTkKcQnMS4hSakxCn0JyEOIXmJMQpNCchTjFTKbVTHJYfK+MwdDQxqa8ni3DP9Px5qAUhjlHHQxxiD1sDdb1zegz3RG0clp8dr0Btfu4C1OYuLEBtZvacul6p6N+hiEgqlYHaoKynZkRE5s5N4X0DPZXS6bThnuopTi0dHeF7J5nOQk1ieiplZAx/5uwQvsaz2inUMll8+4eRfu+IiKSS+rXUzqpwT6/73QtM+OQkxCk0JyFOoTkJcQrNSYhTaE5CnEJzEuIUM5UifZzC6HWx1mrpYfnF1Vm4p9Fs4vcyKiNGx42Kj5T+37Oysgr3vPHaK1CbndTTHiIipdIE1PrJAGr5rB6WTxqR99gAh/nbTZze6Bq/Zz6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VgcjI5o1nAYyWgFJMoHVUgEfYp9Z0tM9I2PTcE9lBqcwZi5fgtqo0UMobfWmQppRrCDRd38O8slJiFNoTkKcQnMS4hSakxCn0JyEOIXmJMQpsSgymgERQn5j8MlJiFNoTkKcQnMS4hSakxCn0JyEOIXmJMQp/wNMLfgMByU9KwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'truck'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idx = 1\n",
    "X = X_train[idx:idx+1]\n",
    "show(X)\n",
    "predict(X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "After a few seconds you can check the event display for an outlier detection prediction. This should be false."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Outlier False\n"
     ]
    }
   ],
   "source": [
    "res=!kubectl logs -n cifar10 $(kubectl get pod -n cifar10 -l app=hello-display -o jsonpath='{.items[0].metadata.name}') \n",
    "data= []\n",
    "for i in range(0,len(res)):\n",
    "    if res[i] == 'Data,':\n",
    "        data.append(res[i+1])\n",
    "j = json.loads(json.loads(data[-1]))\n",
    "print(\"Outlier\",j[\"data\"][\"is_outlier\"]==[1])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Outlier Prediction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(0) \n",
    "X_mask, mask = apply_mask(X.reshape(1, 32, 32, 3),\n",
    "                                  mask_size=(10,10),\n",
    "                                  n_masks=1,\n",
    "                                  channels=[0,1,2],\n",
    "                                  mask_type='normal',\n",
    "                                  noise_distr=(0,1),\n",
    "                                  clip_rng=(0,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVjElEQVR4nO2dWWyc53WGz+wLOQt3kSJNUgtl2ZIseVG9yHFg11YWF2mbFE2XtEDRXjlIN6A10KsgaIO2KJBeFLDrtEAbd7sJHMNG6iqx48ixHcG2bFmSZWqhREoUKW7D4ezL//e2Bc57EKlAclC8z+X34pv5ODMvf+Cc75wTCcNQCCH+iP6sD0AI0aE5CXEKzUmIU2hOQpxCcxLilLglPvfi92Ao9+q5d+G+lbmP1PVuF7/ds3//TesoPzUikQjUrMj20Uc/CbWxie1Q+/pf/426/t6HZ+GeXTO3Q62xuQ61M6dPQi0IWup6q92Ae86e+RBq5dIq1JqtJtTarZi6vr5Wg3sqNXzGThe/19BQP9T6+nuh1g239Pdqwy3SqOPfzgvffkX90fHJSYhTaE5CnEJzEuIUmpMQp9CchDiF5iTEKWYqpbyBw/IDRRyGDodG9PV4Hu459uYpqD3+4AGoWZy6eFVdn5nSzycicvyNY7f0Xrcb6Y2/feYZqEWieuqmVMKffSKRglqnmIXaxPg2vK+jp1IajTrcU9qoQG11FZ8/nkxDTSJ6KqVvAP/N6R58xs3yBtRSafzzD8IO1BJx/SzlzRLc02refIEJn5yEOIXmJMQpNCchTqE5CXEKzUmIU2hOQpxiplKkja/Zt5pYq9X0sPzUDK7OeOKhu6B2q32O7to1CV6vC/c8fORxqC1e01MzIiJP/vKv/uQH+59nCfS/rVrVKx9ERCIdHOavV3F6o2l8n9mMnoLpKw7DPTt33AG1jz76GGoSwedoNvXqk0K+D+5JJPFbbZaXoRaK/jsVEQnA9yIisrFRVdfrNVwBcys/YT45CXEKzUmIU2hOQpx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DiF5iTEKf8Nl+3YqiicVIAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'truck'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "show(X_mask)\n",
    "predict(X_mask)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now lets check the event display for a new message. This should show we have found an outlier."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Outlier True\n"
     ]
    }
   ],
   "source": [
    "res=!kubectl logs -n cifar10 $(kubectl get pod -n cifar10 -l app=hello-display -o jsonpath='{.items[0].metadata.name}') \n",
    "data= []\n",
    "for i in range(0,len(res)):\n",
    "    if res[i] == 'Data,':\n",
    "        data.append(res[i+1])\n",
    "j = json.loads(json.loads(data[-1]))\n",
    "print(\"Outlier\",j[\"data\"][\"is_outlier\"]==[1])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will now call our outlier detector directly and ask for the feature scores to gain more information about why it predicted this instance was an outlier."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "od_preds = outlier(X_mask)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now plot those feature scores returned by the outlier detector along with our original image."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABGoAAAERCAYAAAAjakGjAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAABGJEl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HEjstaYJZ9bKdPjK+vxn9vU2MxnRO1O7Dd1zvmknv9KqbG7wdVG/M8GZrqmxERNie22H0zNE85O6LiyivUote1sYMAPpp7dbrdriecrITXHtcJ/PmO7JVPlGEhJXevB7j+35Gp8peqRmPObmRULC90c0qrhGzUAAAAAAAAVwUINAAAAAABARbBQAwAAAAAAUBEs1AAAAAAAAFQECzUAAAAAAAAVwUINAAAAAABARcieXsWybr+WiXWeeku3xxpp+O1Sv/SFT8rcEyfPyHho+C1Pb775Jpl7y8te7Mamp3Wr3nu+/I8yPr/oX8+DTx6RuY8fPuzGmolWYjH6LdL6RrbK3JmZWRmfnfTvxfyMbrmoGrfVa7qt2+iwbnW363K/rfj45p0yd9suvw32rhfdIHM3jeh2cz2iBWYt0R7TgojHDb7mWqLtaKpNq/WKFsmqnamZxR36+QminXtx6Em97RIto1MtFfMzZ2VcEveimBPtpM10C23TLbQLUT+TyrRwLdsqNPr3sVjU7VFVa2PZ1tjMQqL1t2rHG1uJlp0LTT+YyN3wVMvoEq3Lazu2yXi+dVTGw7JfE+KDj8vcVAtXmVvo56NUa2b1XlhOHLOqReKZNStZixLvMhUPma5FqbpfLHbfXliN3dDjtyM3MwvqHZuSaIksW9qXaKe8XqRaDa/WNajt9+fYZmbtLUMyHlr+cWX3PCJz1fOXrLFyDlKuNXMQ71Q5Ts0sNPxnKLb0PU61WZdS9UiUHHW+Zok5rJkV84n5olCmHqm5j5n+bJp6nmJL1OCo57ieDf7pDgAAAAAAYP1goQYAAAAAAKAiWKgBAAAAAACoCBZqAAAAAAAAKoKFGgAAAAAAgIpgoQYAAAAAAKAiWKgBAAAAAACoiBBjXOtjAAAAAAAAgPGNGgAAAAAAgMpgoQYAAAAAAKAiWKgBAAAAAACoCBZqAAAAAAAAKoKFGgAAAAAAgIpgoQYAAAAAAKAi/j+zZKTzNmkHlwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1440x1440 with 4 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_feature_outlier_image(od_preds, \n",
    "                           X_mask, \n",
    "                           X_recon=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tear Down"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "namespace \"cifar10\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete ns cifar10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
